package com.emex.app.web;

import com.emex.app.shared.data.Profit;
import com.emex.app.shared.data.ProfitExample;
import com.emex.app.shared.data.ProfitType;
import com.emex.app.shared.ws.ProfitWebService;
import com.emex.app.web.service.ProfitService;
import com.emex.app.web.service.ProfitTypeService;
import java.util.Date;
import java.util.List;
import javax.ejb.Stateless;
import javax.jws.WebService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;

/**
 *
 * @author Sergey Karavaev
 */
@WebService(serviceName = "ProfitWS", portName = "ProfitWSPort", targetNamespace = "http://emex.com/Profit")
@Stateless(name = "ProfitWS")
public class ProfitWS extends SpringBeanAutowiringSupport implements ProfitWebService {

    @Autowired
    private ProfitService profitService;
    
    @Autowired
    private ProfitTypeService profitTypeService;

    @Override
    public int deleteProfitByPrimaryKey(Integer id) {
        return profitService.deleteProfitByPrimaryKey(id);
    }

    @Override
    public Profit insertProfit(Profit record) {
        return profitService.insertProfit(record);
    }

    @Override
    public List<Profit> selectProfitByExample(ProfitExample profitExample) {
        return profitService.selectProfitByExample(profitExample);
    }

    @Override
    public Profit selectProfitByPrimaryKey(Integer id) {
        return profitService.selectProfitByPrimaryKey(id);
    }

    @Override
    public Profit updateProfitByPrimaryKey(Profit record) {
        return profitService.updateProfitByPrimaryKey(record);
    }

    @Override
    public List<Profit> getAllProfitsByDate(Date date) {
        return profitService.getAllProfitsByDate(date);
    }

    @Override
    public int deleteProfitTypeByPrimaryKey(Integer id) {
        return profitTypeService.deleteProfitTypeByPrimaryKey(id);
    }

    @Override
    public ProfitType insertProfitType(ProfitType record) {
        return profitTypeService.insertProfitType(record);
    }

    @Override
    public List<ProfitType> getAllProfitTypes() {
        return profitTypeService.getAllProfitTypes();
    }

    @Override
    public ProfitType updateProfitType(ProfitType record) {
        return profitTypeService.updateProfitType(record);
    }

    @Override
    public ProfitType selectProfitTypeByPrimaryKey(Integer id) {
        return profitTypeService.selectProfitTypeByPrimaryKey(id);
    }

    @Override
    public List<Profit> getAllProfitsByDateAndProfitType(Date startDate, Date endDate, Integer profitTypeId) {
        return profitService.getAllProfitsByDateAndProfitType(startDate, endDate, profitTypeId);
    }

    @Override
    public List<Profit> getAllProfitsByDateEqualOrGraterThan(Date date) {
        return profitService.getAllProfitsByDateEqualOrGraterThan(date);
    }
}
